package org.vsg.security.model.service;

import java.io.Serializable;
import java.util.Collection;

import org.springframework.dao.DataAccessException;
import org.vsg.common.biz.exception.ServiceException;
import org.vsg.common.pagination.Pagination;
import org.vsg.common.pagination.PaginationException;
import org.vsg.common.pagination.carrier.Carrier;
import org.vsg.security.model.domain.SysMenuResource;
import org.vsg.security.model.domain.UrlResource;


public interface UrlResourceService {

	/**
	 * @param urlResource
	 * @exception ServiceException
	 */
	public void addUrlResource(UrlResource urlResource) throws ServiceException;

	/**
	 * 
	 * @param allUrlResource
	 * @throws DataAccessException
	 */
	public void saveAll(Collection<UrlResource> allUrlResource) throws ServiceException;


	/**
	 * @param urlResource
	 * @exception ServiceException
	 */   
	public void updateUrlResource(UrlResource urlResource) throws ServiceException;
	
	
	/**
	 * @param urlResource
	 * @exception ServiceException
	 */   
	public void updateSimpleUrlResource(UrlResource urlResource) throws ServiceException;

	
	/**
	 * @param pk -- primary key for loading entity
	 * @exception ServiceException
	 */   
	public UrlResource loadUrlResource(Serializable pk) throws ServiceException;
	
	
	/**
	 * @param urlResource
	 * @exception ServiceException
	 */   
	public void deleteUrlResource(UrlResource urlResource) throws ServiceException;


	/**
	 * 
	 * @param all
	 * @throws DataAccessException
	 */
	public void deleteAll(Collection<UrlResource> all) throws ServiceException;

	
	
	
	
   	/** 
   	 * @param carrier
   	 * @exception ServiceException
   	 * @exception PaginationException
   	 */
   	public Pagination pageUrlResource(Carrier carrier) throws ServiceException, PaginationException;
   
   
   	/** 
   	 * @param carrier
     * @exception ServiceException
     * @exception PaginationException
     *
     */
   	public Pagination pageUrlResourceByAll(Carrier carrier) throws ServiceException, PaginationException;
	

   	/**
   	 * show the select all defined
   	 * @return
   	 * @throws ServiceException
   	 */
	public Collection<UrlResource> findByAll() throws ServiceException;

	/**
	 * 
	 * 
	 * @param url
	 * @param context
	 * @return
	 * @throws ServiceException
	 */
	public Collection<UrlResource> findUrlResourceByUrl(String url , String context) throws ServiceException;

	/**
	 * 
	 * @return
	 * @throws ServiceException
	 */
	public Collection<String> findAllContext() throws ServiceException;
	
	/**
	 * 
	 * @param context
	 * @return
	 * @throws ServiceException
	 */
	public Collection<UrlResource> findUrlResourcesByContext(String context) throws ServiceException;

	/**
	 * 
	 * @param urlResource
	 * @param menuResource
	 * @throws ServiceException
	 */
	public void bindingMenuUrlResource(UrlResource urlResource , SysMenuResource menuResource) throws ServiceException ;
}